Skip to content

fix(db): fail closed on NULL retrieval owner_filter#409

Merged
BigSimmo merged 1 commit into
mainfrom
claude/tenancy-fail-closed-rpc
Jul 8, 2026
Merged

fix(db): fail closed on NULL retrieval owner_filter#409
BigSimmo merged 1 commit into
mainfrom
claude/tenancy-fail-closed-rpc

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make retrieval_owner_matches(NULL, …) return false instead of matching every tenant row (tenancy defense-in-depth review §6 item 1).
  • Route demo / local-no-auth / test through the public owner sentinel so app callers never pass NULL.
  • Update schema.sql, drift manifest/allowlist, and schema/owner-scope tests to lock the fail-closed truth table.

Test plan

  • vitest: owner-scope, retrieval-owner-filter-guard, drift-detection, supabase-schema (58 passed)
  • prettier + eslint on changed TS/JSON
  • Apply migration 20260708160000_retrieval_owner_matches_fail_closed.sql on live, then remove body-half of drift allowlist entry for retrieval_owner_matches
  • Confirm golden retrieval eval still green (uses public sentinel)

Made with Cursor

…ilter

Close the tenancy defense-in-depth gap where a null owner_filter matched every
tenant row. Demo/test/local-no-auth now pass the public sentinel instead of
null, and schema/tests encode the fail-closed truth table.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@supabase

supabase Bot commented Jul 8, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo merged commit b97f453 into main Jul 8, 2026
5 of 6 checks passed
@BigSimmo BigSimmo mentioned this pull request Jul 9, 2026
@BigSimmo
BigSimmo deleted the claude/tenancy-fail-closed-rpc branch July 9, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant